<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%--查看某房屋的居住人员--%>
<!DOCTYPE HTML>
<html>
<head>
	<base href="<%=basePath%>pages/weixin/">
	<meta charset="utf-8">
	<title>居住人员列表</title>
 	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
 	<link rel="stylesheet" href="../../static/weui/weuix.min.css"/>
	<script type="text/javascript" src="../../static/weui/zepto.min.js"></script>
	<script>
		$(function() {
			$(document).on('swipeLeft', '#item .weui_media_box', function() {
				$('.weui_cell_ft').hide();
				$('.weui_cell_ft', this).show();
			});
			$(document).on('swipeRight', '#item .weui_media_box', function() {
				$('.weui_cell_ft').hide();
			});
			
			$(document).on('click', '.delete', function() {
				var me = $(this);
				$.confirm("您确定要删除吗?", "确认删除?", function() {
					var box = me.parent().parent('.weui_media_box');
					var oid = box.attr('oid');
					$.getJSON('<%=path%>/wechat/delPersonWeixin.do', {oid: oid}, function(msg) {
						if(msg.success) {
							box.remove();
							$.toast("操作成功");
						}
					});
			   	});
			});
		});
	</script>
	<style>
	.fl {float: left;}
	.txt-right {text-align: right;}
	.weui_cell_ft {margin-top: 5px;}
	.weui_panel_ft {
	    padding: 0 !important;
	    position: static !important;
	}
	</style>
</head>
<body ontouchstart class="page-bg">
<div class="weui_cells_title txt-right">
	<a href="<%=path%>/wechat/addPersonWeixin.do?oid=${houseId}&uid=${uid}" title="增加人员"><span class="icon icon-34 f30 f-green"></span></a>
</div>
<div class="page-bd-15">

	<div class="weui_panel weui_panel_access">
	    <div class="weui_panel_hd">住户信息列表（向左滑动可编辑、删除）</div>
	    <div class="weui_panel_bd" id="item">
	    	<c:forEach var="person" items="${list}">
	        <div class="weui_media_box weui_media_text" oid="${person.oid}">
	            <a href="<%=path%>/wechat/infoPersonWeixin.do?oid=${person.oid}" class="weui_panel_ft">
	            	<h4 class="weui_media_title">${person.name}</h4>
	            </a>
	            <p class="weui_media_desc">
	            	身份证号：${person.cardNo}<br>
	            	<c:if test="${person.gender==0}">男</c:if>
	            	<c:if test="${person.gender==1}">女</c:if>，
	            	${person.age}岁
	            	<c:if test="${person.joinState==1}">，经常参加大宣讲</c:if>
	            	<c:if test="${!empty person.specialType}">，${person.specialType.itemValue}</c:if>
	            </p>
	            <div class="weui_cell_ft hide">
	            	<a class='edit fl' href="<%=path%>/wechat/editPersonWeixin.do?oid=${person.oid}"><i class="icon icon-115 f20 f-blue"></i></a>
	            	<a class='delete' href="javascript:void(0);"><i class="icon icon-26 f20 f-blue"></i></a>
	            </div>
	        </div>
	        </c:forEach>
	        
	    </div>
	</div>       

</div>
</body>
</html>
